#ifndef MEDIATOR_H
#define MEDIATOR_H
#include<iostream>
#include<QList>
//抽象中介者
using namespace std;
class IColleague;
class IMediator{
public:
    virtual ~IMediator(){}
    //注册参与者
    virtual void registerColleague(IColleague *colleague);
    //注销参与者
    virtual void unRegisterColleague(IColleague *colleague);
    //返回所有参与者
     QList<IColleague*> getColleagues() const;
    //将发送者的消息发送给所有参与者
    virtual void distributeMessage(const IColleague *sender,const std::string &message)const=0;

private:

   QList<IColleague*> m_colleagues;
};







#endif // MEDIATOR_H
